﻿#pragma once

#include <QtWidgets/QMainWindow>
#include <QTextEdit>
#include <QPushButton>
#include <QFileDialog>
#include <QTextCharFormat>
#include <QMessageBox>
#include <QDesktopServices>
#include <QUrl> 
#include "ui_GUI.h"


class GUI : public QMainWindow
{
    Q_OBJECT

public:
    GUI(QWidget* parent = nullptr);
    ~GUI();

private:
    Ui::GUIClass ui;
    QMenuBar* bar;
    QMenu* fileMenu, * aboutMenu;
    QAction* openAction, * saveAction, * exitAction, * authorAction, * intruduceAction;
    QTextEdit* codeEdit, * pcodeEdit, * dstackEdit, * commsEdit, * inoutEdit;
    QPushButton* comButton, * ssButton, * exButton;

    void PDataStack();
    int GetInputData();

private slots:
    void OpenFile();
    void SaveFile();
    void Exit();
    void Compiler();
    void Interpret();
    void SingleInterpret();
    void Execute();
    void PrintPCode();
    void PrintEMS();
    void PrintTable();
    void Author();
    void Introduce();
};